

#pragma once

//#ifndef CmASSERT
//#define CmASSERT
//#endif
//
//#ifndef CmVERIFY
//#define CmVERIFY
//#endif
//
//#ifndef CmASSERTFAIL_MSG
//#define CmASSERTFAIL_MSG
//#endif
//
//#ifndef CmTRACE
//#define CmTRACE ::wprintf_s
//#endif
//
//#ifndef CmSAFE_DELETE
//#define CmSAFE_DELETE
//#endif
//
//#define LOG_MGR__LIGHT
//#define LOG_MGR__MUST


////
//already implemented in commonlib
//
////http://msdn.microsoft.com/ko-kr/library/xcb2z8hs.aspx
// //
//// Usage: SetThreadName (-1, "MainThread");
////
//#include <windows.h>
//const DWORD MS_VC_EXCEPTION=0x406D1388;
//
//#pragma pack(push,8)
//typedef struct tagTHREADNAME_INFO
//{
//   DWORD dwType; // Must be 0x1000.
//   LPCSTR szName; // Pointer to name (in user addr space).
//   DWORD dwThreadID; // Thread ID (-1=caller thread).
//   DWORD dwFlags; // Reserved for future use, must be zero.
//} THREADNAME_INFO;
//#pragma pack(pop)
//
//inline void _SetThreadName( DWORD dwThreadID, char* threadName)
//{
//   THREADNAME_INFO info;
//   info.dwType = 0x1000;
//   info.szName = threadName;
//   info.dwThreadID = dwThreadID;
//   info.dwFlags = 0;
//
//   __try
//   {
//      RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info );
//   }
//   __except(EXCEPTION_EXECUTE_HANDLER)
//   {
//   }
//}
//
//template<typename T>
//struct deletePtr: std::unary_function<T*, void>
//{
//	void operator()(T* ptr)
//	{
//		delete ptr;
//	}
//};
//
////
//already implemented in commonlib
//class CriticalObj
//{
//public:
//	CriticalObj()
//	{
//		::InitializeCriticalSectionAndSpinCount(&m_cs, 0x80000400);
//	}
//	virtual ~CriticalObj()
//	{
//		::DeleteCriticalSection(&m_cs);
//	}
//
//	void Lock()
//	{
//		::EnterCriticalSection(&m_cs);
//	}
//	void Unlock()
//	{
//		::LeaveCriticalSection(&m_cs);
//	}
//
//	CRITICAL_SECTION* GetCriticalObj() const {return &m_cs;	}
//
//protected:
//	mutable CRITICAL_SECTION m_cs;
//	CriticalObj(const CriticalObj&);
//};
